import { StyleSheet } from 'react-native';

import { globalStyles as _globalStyles } from '@/style'
import __i18nInstance, { I18nScope, TranslateOptions, switchLanguage as __switchLanguage } from '@/i18n'

declare global {
    let globalStyles: ReturnType<typeof StyleSheet.create>;
    let t: <T = string>(scope: I18nScope, options?: TranslateOptions) => string | T;
    let i18nInstance: typeof __i18nInstance;
    let switchLanguage: typeof __switchLanguage;
}

// 设置全局样式
globalStyles = _globalStyles as ReturnType<typeof StyleSheet.create>;

// 国际化
t = __i18nInstance.t.bind(__i18nInstance);
i18nInstance = __i18nInstance;
switchLanguage = __switchLanguage;

